//
//  ViewController.swift
//  demo
//
//  Created by toro宇 on 2020/2/13.
//  Copyright © 2020 CodeYu. All rights reserved.
//
import Then

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .white
        self.navigationController?.navigationBar.isHidden = true
//        UIButton.setJumpButton(self, antion: #selector(JumpAction(_:)))
        
        // 跳转ETC详情
        let ectDetailBtn = UIButton().then {
            $0.setTitle("ETC详情", for: .normal)
            $0.setTitleColor(UIColor.red, for: .normal)
            $0.backgroundColor = UIColor.gray
        }
        
        view.addSubview(ectDetailBtn)
        ectDetailBtn.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalToSuperview().offset(100)
            make.size.equalTo(CGSize(width: 80, height: 40))
        }
        
        ectDetailBtn.actionBlock = { _ in
    self.navigationController?.pushViewController(XiangQingViewController(), animated: true)
        }
        
        
        let btn = UIButton().then {
            $0.setTitle("申请记录", for: .normal)
            $0.setTitleColor(UIColor.red, for: .normal)
            $0.backgroundColor = UIColor.gray
        }
        
        view.addSubview(btn)
        btn.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalTo(ectDetailBtn.snp.bottom).offset(20)
            make.size.equalTo(CGSize(width: 80, height: 40))
        }
        
        btn.actionBlock = { _ in
            self.navigationController?.pushViewController(ShenQingJiLvViewController(), animated: true)
        }
        
        //MARK: --地址编辑
        let btn1 = UIButton().then {
            $0.setTitle("申请记录", for: .normal)
            $0.setTitleColor(UIColor.red, for: .normal)
            $0.backgroundColor = UIColor.gray
        }
        
        view.addSubview(btn1)
        btn1.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalTo(btn.snp.bottom).offset(20)
            make.size.equalTo(CGSize(width: 80, height: 40))
        }
        
        btn1.actionBlock = { _ in
            self.navigationController?.pushViewController(AddressEditViewController(), animated: true)
        }
        
        //MARK: --地址选择
        let btn2 = UIButton().then {
            $0.setTitle("地址选择", for: .normal)
            $0.setTitleColor(UIColor.red, for: .normal)
            $0.backgroundColor = UIColor.gray
        }
        
        view.addSubview(btn2)
        btn2.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalTo(btn1.snp.bottom).offset(20)
            make.size.equalTo(CGSize(width: 80, height: 40))
        }
        
        btn2.actionBlock = { _ in
            self.navigationController?.pushViewController(AddressChoiceViewController(), animated: true)
        }
        
        
        
       
        
        
        // Do any additional setup after loading the view.
    }
   @objc func JumpAction(_ sender: UIButton) {
//        self.navigationController?.pushViewController(ZZJLViewController(), animated: true)
    
//    self.navigationController?.pushViewController(ShenQingViewController(), animated: true)
     self.navigationController?.pushViewController(ShenQingJiLvViewController(), animated: true)
    
    }

}

